﻿#region << 文 件 说 明 >>
/*----------------------------------------------------------------
// 文件名称：ConnectionModel
// 创 建 者：杨程
// 创建时间：2021/9/1 17:43:07
// 文件版本：V1.0.0
// ===============================================================
// 功能描述：
//		
//
//----------------------------------------------------------------*/
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vampirewal.Core.Models;

namespace V.CodeGenerator.ViewModel.Model.Connection
{
    /// <summary>
    /// 数据库连接model
    /// </summary>
    public class ConnectionModel:BillBaseModel
    {
        private string _ConnectionName;

        /// <summary>
        /// 连接名
        /// </summary>
        public string ConnectionName
        {
            get { return _ConnectionName; }
            set { _ConnectionName = value;DoNotify(); }
        }

        private string _ServerAddress;
        /// <summary>
        /// 服务器地址
        /// </summary>
        public string ServerAddress
        {
            get { return _ServerAddress; }
            set { _ServerAddress = value; DoNotify(); }
        }

        private string _InitializeDB;
        /// <summary>
        /// 初始化数据库
        /// </summary>
        public string InitializeDB
        {
            get { return _InitializeDB; }
            set { _InitializeDB = value; DoNotify(); }
        }

        private string _UserName;
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; DoNotify(); }
        }

        private string _PassWord;
        /// <summary>
        /// 密码
        /// </summary>
        public string PassWord
        {
            get { return _PassWord; }
            set { _PassWord = value; DoNotify(); }
        }

        private string _ConnectionString;
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectionString
        {
            get { return _ConnectionString; }
            set { _ConnectionString = value; DoNotify(); }
        }

        private bool _IsConnectioned;
        /// <summary>
        /// 是否连接
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public bool IsConnectioned
        {
            get { return _IsConnectioned; }
            set { Set(ref _IsConnectioned, value); }
        }


        /// <summary>
        /// 清空这个类的属性值
        /// </summary>
        public void CleraProp()
        {
            ConnectionName = string.Empty;
            ServerAddress = string.Empty;
            InitializeDB = string.Empty;
            UserName = string.Empty;
            PassWord = string.Empty;
            ConnectionString = string.Empty;
        }
    }

    public class DBList
    {
        public string DBName { get; set; }

        public string DBConnectionString { get; set; }
    }
}
